import tabbarItems from '../../common/datas/tabbarItem_doctor.js';
import router from '@system.router';

export default {
    data: {
        tabbarItems
    },
// 接收父组件传递的参数
//props:["index"],
    props: {
        index: {
            type: Number,
            default() { // 设置默认值
                return 0;
            }
        }
    },
    jump(index) {  // 路由的跳转
        //        this.tabbarItems.forEach((item,index) => {
        //            item.img = tabbarItems[index].img;
        //        });
        //        this.tabbarItems[index].img = this.tabbarItems[index].simg;
        switch (index) {
            case 0:
                router.replace({
                    uri: "pages/manage_doctor/index",
                    params: {
                        info: "这是路由传递的参数"
                    }
                });
                break;
        }
        switch (index) {
            case 1:
                router.replace({
                    uri: "pages/assessment_doctor/index",
                    params: {
                        info: "这是路由传递的参数"
                    }
                });
                break;
        }
        switch (index) {
            case 2:
                router.replace({
                    uri: "pages/me_doctor/index",
                    params: {
                        info: "这是路由传递的参数"
                    }
                });
                break;
        }
    }
}